Add the correct alignment magic for Sun compiler and for GCC to get the
authorOwen Taylor <otaylor@redhat.com>
Mon, 18 Aug 2003 15:17:03 +0000 (15:17 +0000)
committerOwen Taylor <otaylor@src.gnome.org>
Mon, 18 Aug 2003 15:17:03 +0000 (15:17 +0000)
Mon Aug 18 10:25:29 2003  Owen Taylor  <otaylor@redhat.com>

        * gdk-pixdata.c (gdk_pixdata_to_csource): Add the correct
        alignment magic for Sun compiler and for GCC to get
        the strings aligned. (Patch from Brian Cameron, #117217)

gdk-pixbuf/ChangeLog
gdk-pixbuf/gdk-pixdata.c

index 3c3a723b133c05814523dd500981ae88bcf3c1d7..bc072dc9cbd4d9bba4cede197a6e6f27e5f71711 100644 (file)
@@ -1,3 +1,9 @@
+Mon Aug 18 10:25:29 2003  Owen Taylor  <otaylor@redhat.com>
+
+       * gdk-pixdata.c (gdk_pixdata_to_csource): Add the correct
+       alignment magic for Sun compiler and for GCC to get
+       the strings aligned. (Patch from Brian Cameron, #117217)
+
 2003-08-14  Matthias Clasen  <maclas@gmx.de>
 
        * gdk-pixdata.c (gdk_pixdata_to_csource): Improve doc comment
index f8730c30151445d561fe68cd4ea2cabbcefcdfcc..445e7adf7f0a9c0d254101f8769134b6b4529b3d 100644 (file)
@@ -727,10 +727,22 @@ gdk_pixdata_to_csource (GdkPixdata        *pixdata,
       img_buffer = stream;
       img_buffer_end = stream + stream_length;
 
+      APPEND (gstring, "#ifdef __SUNPRO_C\n");
+      APPEND (gstring, "#pragma align 4 (%s)\n", name);   
+      APPEND (gstring, "#endif\n");
+
+      APPEND (gstring, "#ifdef __GNUC__\n");
+      APPEND (gstring, "%s%s%s %s[] __attribute__ ((__aligned__ (4))) = \n",
+             cdata.static_prefix, cdata.const_prefix,
+             cdata.dump_gtypes ? "guint8" : "unsigned char",
+             name);
+      APPEND (gstring, "#else\n");
       APPEND (gstring, "%s%s%s %s[] = \n",
              cdata.static_prefix, cdata.const_prefix,
              cdata.dump_gtypes ? "guint8" : "unsigned char",
              name);
+      APPEND (gstring, "#endif\n");
+
       APPEND (gstring, "{ \"\"\n  /* Pixbuf magic (0x%x) */\n  \"",
              GDK_PIXBUF_MAGIC_NUMBER);
       cdata.pos = 3;